package redstone;

import org.bukkit.Bukkit;
import org.bukkit.Location;
import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
import org.bukkit.event.player.PlayerMoveEvent;
     
public class ExamplePlayerListener implements Listener {

    public static Example plugin;

    public ExamplePlayerListener(Example instance) {
        plugin = instance;
        Bukkit.getServer().getPluginManager().registerEvents(this, plugin);
    }

    @EventHandler(priority = EventPriority.LOW)
    public void onPlayerMove(PlayerMoveEvent event){
            Player player = event.getPlayer();
            Location playerLoc = player.getLocation();

            player.sendMessage("Your X Coordinates : " + playerLoc.getX());
            player.sendMessage("Your Y Coordinates : " + playerLoc.getY());
            player.sendMessage("Your Z Coordinates : " + playerLoc.getZ());
    }

}

